package com.web.kongjian.ao.utils;

import javax.servlet.http.HttpServletRequest;

import com.web.user.member.utils.CookieUtils;

import cn.mysteel.util.StringUtils;

public class KongjianUtils
{
	
	public static long getMemberIdByCookie(HttpServletRequest request)
	{
		String str = CookieUtils.getCookieValue (request ,"member_id");
		
		long memberId = 0L;
		
		if(!StringUtils.isTrimEmpty (str))
		{
			memberId = Long.parseLong (str);
		}
		
		return memberId;
	}
	
	public static long getMemberIdByParams(HttpServletRequest request)
	{
		String str = request.getParameter ("memberId");
		
		long memberId = 0L;
		
		if(!StringUtils.isTrimEmpty (str))
		{
			memberId = Long.parseLong (str);
		}
		
		return memberId;
	}
	
}
